// src/i18n/index.js
import { createI18n } from 'vue-i18n'
import en from './language/en'
import zh from './language/zh'

const messages = {
  en: {
    ...en
  },
  zh: {
    ...zh
  }
}

const i18n = createI18n({
  legacy: false,
  locale: localStorage.getItem('language') || 'zh', // 默认语言
  fallbackLocale: 'en', // 回退语言
  messages
})

export default i18n
